﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NPSoft.Ferrero.Framework.Application
{

    public interface IAppService<T> where T : class,new()
    {
        /// <summary>
        /// Add
        /// </summary>
        /// <param name="info">ModelInfo</param>
        /// <returns>Return Message</returns>
        string Add(T info);

        /// <summary>
        /// Edit
        /// </summary>
        /// <param name="info">ModelInfo</param>
        /// <returns>Return Message</returns>
        string Edit(T info);

        /// <summary>
        /// Remove
        /// </summary>
        /// <param name="info">ModelInfo</param>
        /// <returns>Return Message</returns>
        string Remove(T info);

        /// <summary>
        /// Get Model infomation By Id
        /// </summary>
        /// <param name="id">Primary Key</param>
        /// <returns>ModelInfo</returns>
        T GetById(Guid id);

        /// <summary>
        /// Get Model infomation By Id
        /// </summary>
        /// <param name="id">Primary Key</param>
        /// <returns>ModelInfo</returns>
        T GetById(long id);

        /// <summary>
        /// Search
        /// </summary>
        /// <param name="condtion">Where Condtion</param>
        /// <returns>Result List</returns>
        ICollection<T> Search(StringBuilder condtion);
    }
}
